Vue.component('headers', { //头部组件
    data: function() {
        return {

        }
    },
    props: ['title', 'icon', 'bcolor', 'iconcolor', 'iconcolors', 'icons', 'rightClick'],
    template: '<div class="headers" :style="{backgroundColor:bcolor}"><a v-if="icons" href="#" @click.stop="goBack" ><span class="iconfont"   :class="icons"></span></a><span  class="text">{{title}}</span><a v-if="icon" @click.stop="rightClick" href="#" class="rights" ><span class="iconfont " :style="{color:iconcolor}"  :class="icon"></span></a></div>',
    methods: {
        goBack() {
            var pageId = plus.webview.currentWebview()
                // var list = plus.webview.currentWebview().opener();　
                // if (!refresh) {
            plus.webview.close(pageId)
                // } else {
                //     mui.fire(list, 'refresh');
                //     plus.webview.close(pageId)
                // }
        }
    }
})
Vue.component('headering', { //头部组件
    data: function() {
        return {

        }
    },
    props: ['title', 'bcolor'],
    template: '<div class="headers" :style="{backgroundColor:bcolor}"><span class="text">{{title}}</span></div>'
})
Vue.component('msgmodel', {
    data: function() {
        return {
            paddingTops: (window.innerHeight - 100) / 2 + 'px',
        }
    },
    props: ['title', 'icon', 'show'],
    template: '<div v-if="show" class="msgModel" :style="{paddingTop:paddingTops}">' +
        '<div>' +
        '<span class="iconfont" :class="icon"></span>' +
        '<span>{{title}}</span>' +
        '</div>' +
        '</div>'
})
Vue.component('contentmodel', { //模态层组件
    data: function() {
        return {
            winHeight: window.innerHeight
        }
    },
    props: ['content', 'close', 'ok', 'modelshow'],
    template: '<div v-if="modelshow" class="contentModel" :style="{height:winHeight+\'px\',paddingTop:(winHeight-420)/2+\'px\'}">' +
        '<div class="conBox">' +
        '<div class="imgs" :style="{top:(winHeight-520)/2+\'px\'}">' +
        '<img :src="content.src" alt="">' +
        '</div>' +

        '<span class="title">{{content.title}}</span>' +
        '<div class="contentText">' +
        '<p>{{content.p}}</p>' +
        '<p>{{content.p}}</p>' +
        '</div>' +
        '<div class="modelBtn">' +
        '<a href="#" @click.stop="close">不同意</a>' +
        '<a href="#" @click.stop="ok">同意并继续</a>' +
        '</div>' +
        '</div>' +
        '</div>'
})
Vue.component('lists', { //首页分类列表组件
    data: function() {
        return {

        }
    },
    props: ['info', 'clicks'],
    template: '<ul class="lists bottomBor">' +
        '<li  v-for="(item,index) in info"><a v-on:click.stop="clicks(index)" :data-id="item.t_dict_name">' +
        '<img :src="item.institution_type_img" alt="">' +
        '<span>{{item.t_dict_name}}</span>' +
        '<a/></li>' +
        '</ul>'
})
Vue.component('fx', { //发现组件
    data: function() {
        return {

        }
    },
    props: ['fxinfo', 'fxclick'],
    template: '<div class="fx">' +
        '<div class="title">' +
        '<span>发现</span>' +
        '</div>' +
        '<div class="box">' +
        '<div>' +
        '<img :src="fxinfo.one.src" @click.stop="fxclick" :data-id="fxinfo.one.id" alt="">' +
        '</div>' +
        '<div>' +
        '<div>' +
        '<img :src="fxinfo.two.src" @click.stop="fxclick" :data-id="fxinfo.two.id" alt="">' +
        '</div>' +
        '<div>' +
        '<img :src="fxinfo.there.src" @click.stop="fxclick" :data-id="fxinfo.there.id" alt="">' +
        '</div>' +
        '</div>' +
        '</div>' +
        '</div>'
})
Vue.component('menulist', {
    data: function() {
        return {

        }
    },
    props: ['title', 'listinfo', 'gotofunction'],
    template: '<div class="menuList">' +
        '<div class="title">' +
        '    <span>{{title}}</span>' +
        '</div>' +
        '<ul>' +
        '    <li v-for="(item,index) in listinfo" @click.stop="gotofunction(item.id)">' +
        '        <img :src="item.src" />' +
        '        <span>{{item.name}}</span>' +
        '    </li>' +
        '</ul>' +
        '</div>'
})
Vue.component('jxkc', { //精选课程
    data: function() {
        return {

        }
    },
    props: ['list', 'jxkcclick', 'gd'],
    template: '<div class="jxkc">' +
        '<div class="title">' +
        '<span class="name">精选课程</span>' +
        '<span @click.stop="gd" class="iconfont icon-more"></span>' +
        '</div>' +
        '<ul class="box">' +
        '<li v-for="(item,index) in list" @click.stop="jxkcclick(index)" :data-id="item.t_institution_id">' +
        '<img :src="item.t_course_cover" alt="">' +
        '<span class="name">{{item.t_course_name}}</span>' +
        '<p><span class="iconfont icon-fire-fill"></span><span>{{item.t_course_views}}人观看</span></p>' +
        '</li>' +
        '</ul>' +
        '</div>'
})
Vue.component('worklists', {
    data: function() {
        return {

        }
    },
    props: ['worklist', 'goto'],
    template: '<ul class="workList">' +
        '<li v-for="(item,index) in worklist" @click.stop="goto(index)" :data-id="item.t_institution_id">' +
        '<img :src="item.t_institution_img" alt="">' +
        '<div>' +
        '<p>{{item.t_institution_name}}<span>{{item.t_institution_point}}分</span></p>' +
        '<span>{{item.t_institution_address}} | {{item.distance_km}}KM</span>' +
        '<a href="#">关注+</a>' +
        '</div>' +
        '</li>' +
        '</ul>'
})
Vue.component('tab', { //头部组件
    data: function() {
        return {

        }
    },
    props: ['info', 'clicks', 'type'],
    template: '<ul class="tab" >' +
        '<li align="absbottom" v-for="(item,index) in info" :data-index="index" :data-id="item.id" v-on:click.stop="clicks" :class="type==item.id?\'isActive\':\' \'">{{item.name}}</li></ul>'
})